import { lazy } from "react";
import {createBrowserRouter} from 'react-router-dom'
let Home=lazy(()=>import('../pages/home/Index'))
let My=lazy(()=>import('../pages/my/Index'))
let MainLayout=lazy(()=>import('../pages/mainLayout/Index'))
let Login=lazy(()=>import('../pages/login/Index'))
let News=lazy(()=>import('../pages/news/Index'))
let Sousuo=lazy(()=>import('../pages/sousuo/Index'))
let List=lazy(()=>import('../pages/list/Index'))
const routes=createBrowserRouter([
    {
        path:'/',
        element:<MainLayout></MainLayout>,
        children:[
            {
                path:'/home',
                element:<Home></Home>
            },
            {
               path:'/my',
               element:<My></My>
            },
            {
                path:'/news',
                element:<News></News>
            }
        ]
    },
    {
    path:'/login',
    element:<Login></Login>
    },
    {
    path:'/sousuo',
    element:<Sousuo></Sousuo>
    },
    {
    path:'/list',
    element:<List></List>
    }
])
export default routes